//mustone.js
//私藏博物馆点开的石头列表
//获取应用实例
const app = getApp()

Page({
  data: {
    list: [],
    stonelist:[],
  },
  
  onLoad: function (options) {
    // console.log(options)
    wx.setNavigationBarTitle({
      title: options.name
    })
    var self = this
    // 私藏馆主体
    wx.request({
      url: app.serverUrl + 'Abouttwo/showMuseumfind?museumid='+1,
      method: 'POST',
      header: {
        "Content-Type": "application/x-www-form-urlencoded"
      },
      data: {
        openid: app.openid
      },
      success: function (res) {
        console.log(res);
        self.setData({
          list: res.data.data,
        })

      },
    });
    // 石头分类列表
    wx.request({
      
      url: app.serverUrl + 'Abouttwo/showStonetypelist?museumid=' + options.museumid,
      method: 'POST',
      header: {
        "Content-Type": "application/x-www-form-urlencoded"
      },
      data: {
        openid: app.openid
      },
      success: function (res) {
        console.log(res);
        self.setData({
          stonelist: res.data.data,
        })
      },
    })
    
  },
  // onShow: function (options) {
  //   var self = this
  //   wx.request({
  //     url: app.serverUrl + 'About/showStonetypelist?museumid=' + 1,
  //     method: 'POST',
  //     header: {
  //       "Content-Type": "application/x-www-form-urlencoded"
  //     },
  //     data: {
  //       openid: app.openid
  //     },
  //     success: function (res) {
  //       console.log(res);
  //       self.setData({
  //         stonelist: res.data.data,
  //       })
  //       // console.log(res.data.data[0])
  //     },
  //   })

  // },
  stonelist:function(res)
  {
    var self = this;
    console.log(res);
    var url = res.currentTarget.dataset.url;
    var stonetypeid = res.currentTarget.dataset.stonetypeid;
   wx.navigateTo({
      url: url + '?stonetypeid=' + stonetypeid,

      
      
    })
  }


})